PageSourceSearch

https://unframer.co/assets/create-proxy-BnPD-_8G.js

js unframer.co collected 2026-10-06 19:29:41 UTC 14,292 bytes, 9 lines download raw bytes

1globalThis.STRADA_RELEASE={commit:`8baab3aec8ff48dc5fbac483694f40eec8e5f6b2`,branch:`preview`,deploymentId:`8baab3aec8ff48dc5fbac483694f40eec8e5f6b2`};import{n as e,o as t,r as n,s as r}from"./rolldown-runtime-BO1D7fPK.js";import{t as i}from"./jsx-runtime-B44_mNpU.js";import{t as a}from"./react-BIe5H-YT.js";import{A as o,M as s,N as c,T as l,a as u,b as d,c as f,d as p,g as m,h,i as g,n as _,o as v,r as y,t as b,u as x,y as S}from"./is-svg-component-BQMeP-CJ.js";var C=r(i(),1),w=r(a(),1),T=(0,w.createContext)({});function useConstant(e){let t=(0,w.useRef)(null);return t.current===null&&(t.current=e()),t.current}var E=typeof window<`u`?w.useLayoutEffect:w.useEffect,D=(0,w.createContext)(null);function resolveMotionValue(e){return s(e)?e.get():e}var O=(0,w.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function setRef(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function composeRefs(...e){return t=>{let n=!1,r=e.map(e=>{let r=setRef(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():setRef(e[t],null)}}}}function useComposedRefs(...e){return w.useCallback(composeRefs(...e),e)}var PopChildMeasure=class extends w.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(l(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=l(e)&&e.offsetWidth||0,r=l(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function PopChild({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,w.useId)(),s=(0,w.useRef)(null),c=(0,w.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:l}=(0,w.useContext)(O),u=useComposedRefs(s,a===!1?void 0:e.props?.ref??e?.ref);return(0,w.useInsertionEffect)(()=>{let{width:e,height:u,top:d,left:f,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!u)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let y=document.createElement(`style`);l&&(y.nonce=l);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
2          [data-motion-pop-id="${o}"] {
3            position: absolute !important;
4            width: ${e}px !important;
5            height: ${u}px !important;
6            ${_}px !important;
7            ${v}px !important;
8          }
9        `),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,C.jsx)(PopChildMeasure,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:w.cloneElement(e,{ref:u})})}var PresenceChild=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=useConstant(newChildrenMap),d=(0,w.useId)(),f=(0,w.useRef)(n),p=(0,w.useRef)(r);E(()=>{f.current=n,p.current=r});let m=!0,h=(0,w.useMemo)(()=>(m=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>{u.delete(e),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&m&&(h={...h}),(0,w.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),w.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,C.jsx)(PopChild,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,C.jsx)(D.Provider,{value:h,children:e})};function newChildrenMap(){return new Map}function usePresence(e=!0){let t=(0,w.useContext)(D);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,w.useId)();(0,w.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,w.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var getChildKey=e=>e.key||``;function onlyElements(e){let t=[];return w.Children.forEach(e,e=>{(0,w.isValidElement)(e)&&t.push(e)}),t}var AnimatePresence=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=usePresence(o),f=(0,w.useMemo)(()=>onlyElements(e),[e]),p=o&&!u?[]:f.map(getChildKey),m=(0,w.useRef)(!0),h=(0,w.useRef)(f),g=useConstant(()=>new Map),_=(0,w.useRef)(new Set),[v,y]=(0,w.useState)(f),[b,x]=(0,w.useState)(f);E(()=>{m.current=!1,h.current=f;for(let e=0;e<b.length;e++){let t=getChildKey(b[e]);p.includes(t)?(g.delete(t),_.current.delete(t)):g.get(t)!==!0&&g.set(t,!1)}}
9,[b,p.length,p.join(`-`)]);let S=[];if(f!==v){let e=[...f];for(let t=0;t<b.length;t++){let n=b[t],r=getChildKey(n);p.includes(r)||(e.splice(t,0,n),S.push(n))}return a===`wait`&&S.length&&(e=S),x(onlyElements(e)),y(f),null}let{forceRender:D}=(0,w.useContext)(T);return(0,C.jsx)(C.Fragment,{children:b.map(e=>{let v=getChildKey(e),y=o&&!u?!1:f===b||p.includes(v),onExit=()=>{if(_.current.has(v))return;if(g.has(v))_.current.add(v),g.set(v,!0);else return;let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(D?.(),x(h.current),o&&d?.(),r&&r())};return(0,C.jsx)(PresenceChild,{isPresent:y,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:y?void 0:onExit,anchorX:s,anchorY:c,children:e},v)})})},k=(0,w.createContext)({strict:!1}),A={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},j=!1;function initFeatureDefinitions(){if(j)return;let e={};for(let t in A)e[t]={isEnabled:e=>A[t].some(t=>!!e[t])};p(e),j=!0}function getInitializedFeatureDefinitions(){return initFeatureDefinitions(),x()}function loadFeatures(e){let t=getInitializedFeatureDefinitions();for(let n in e)t[n]={...t[n],...e[n]};p(t)}var M=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function isValidMotionProp(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||M.has(e)}var N=n({default:()=>P}),P,F=e((()=>{throw P={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),shouldForward=e=>!isValidMotionProp(e);function loadExternalIsValidProp(e){typeof e==`function`&&(shouldForward=t=>t.startsWith(`on`)?!isValidMotionProp(t):e(t))}try{loadExternalIsValidProp((F(),t(N)).default)}catch{}function filterProps(e,t,n){let r={};for(let i in e)(i!==`values`||typeof e.values!=`object`)&&(s(e[i])||(shouldForward(i)||n===!0&&isValidMotionProp(i)||!t&&!isValidMotionProp(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]));return r}var I=(0,w.createContext)({});function getCurrentTreeVariants(e,t){if(h(e)){let{initial:t,animate:n}=e;return{initial:t===!1||S(t)?t:void 0,animate:S(n)?n:void 0}}return e.inherit===!1?{}:t}function useCreateMotionContext(e){let{initial:t,animate:n}=getCurrentTreeVariants(e,(0,w.useContext)(I));return(0,w.useMemo)(()=>({initial:t,animate:n}),[variantLabelsAsDependency(t),variantLabelsAsDependency(n)])}function variantLabelsAsDependency(e){return Array.isArray(e)?e.join(` `):e}var createHtmlRenderState=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function copyRawValuesOnly(e,t,n){for(let r in t)!s(t[r])&&!v(r,n)&&(e[r]=t[r])}function useInitialMotionValues({transformTemplate:e},t){return(0,w.useMemo)(()=>{let n=createHtmlRenderState();return f(n,t,e),Object.assign({},n.vars,n.style)},[t])}function useStyle(e,t){let n=e.style||{},r={};return copyRawValuesOnly(r,n,e),Object.assign(r,useInitialMotionValues(e,t)),r}function useHTMLProps(e,t){let n={},r=useStyle(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var createSvgRenderState=()=>({...createHtmlRenderState(),attrs:{}});function useSVGProps(e,t,n,r){let i=(0,w.useMemo)(()=>{let n=createSvgRenderState();return g(n,t,y(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};copyRawValuesOnly(t,e.style,e),i.style={...t,...i.style}}return i}function useRender(e,t,n,{latestValues:r},i,a=!1,o){let c=(o??b(e)?useSVGProps:useHTMLProps)(t,r,i,e),l=filterProps(t,typeof e==`string`,a),u=e===w.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,w.useMemo)(()=>s(d)?d.get():d,[d]);return(0,w.createElement)(e,{...u,children:f})}function makeState({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:makeLatestValues(n,r,i,e),renderState:t()}}function makeLatestValues(e,t,n,r){let i={}
9,a=r(e,{});for(let e in a)i[e]=resolveMotionValue(a[e]);let{initial:o,animate:s}=e,l=h(e),u=m(e);t&&u&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let f=n?n.initial===!1:!1;f||=o===!1;let p=f?s:o;if(p&&typeof p!=`boolean`&&!d(p)){let t=Array.isArray(p)?p:[p];for(let n=0;n<t.length;n++){let r=c(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=f?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var makeUseVisualState=e=>(t,n)=>{let r=(0,w.useContext)(I),i=(0,w.useContext)(D),make=()=>makeState(e,t,r,i);return n?make():useConstant(make)},L=makeUseVisualState({scrapeMotionValuesFromProps:u,createRenderState:createHtmlRenderState}),R=makeUseVisualState({scrapeMotionValuesFromProps:_,createRenderState:createSvgRenderState}),z=Symbol.for(`motionComponentSymbol`);function useMotionRef(e,t,n){let r=(0,w.useRef)(n);(0,w.useInsertionEffect)(()=>{r.current=n});let i=(0,w.useRef)(null);return(0,w.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var B=(0,w.createContext)({});function isRefObject(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function useVisualElement(e,t,n,r,i,a){let{visualElement:s}=(0,w.useContext)(I),c=(0,w.useContext)(k),l=(0,w.useContext)(D),u=(0,w.useContext)(O),d=u.reducedMotion,f=u.skipAnimations,p=(0,w.useRef)(null),m=(0,w.useRef)(!1);r||=c.renderer,!p.current&&r&&(p.current=r(e,{visualState:t,parent:s,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:d,skipAnimations:f,isSVG:a}),m.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));let h=p.current,g=(0,w.useContext)(B);h&&!h.projection&&i&&(h.type===`html`||h.type===`svg`)&&createProjectionNode(p.current,n,i,g);let _=(0,w.useRef)(!1);(0,w.useInsertionEffect)(()=>{h&&_.current&&h.update(n,l)});let v=n[o],y=(0,w.useRef)(!!v&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return E(()=>{m.current=!0,h&&(_.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),y.current&&h.animationState&&h.animationState.animateChanges())}),(0,w.useEffect)(()=>{h&&(!y.current&&h.animationState&&h.animationState.animateChanges(),y.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(v)}),!1),h.enteringChildren=void 0)}),h}function createProjectionNode(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:getClosestProjectingNode(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&isRefObject(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function getClosestProjectingNode(e){if(e)return e.options.allowProjection===!1?getClosestProjectingNode(e.parent):e.projection}function createMotionComponent(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&loadFeatures(r);let a=n?n===`svg`:b(e),o=a?R:L;function MotionDOMComponent(n,s){let c,l={...(0,w.useContext)(O),...n,layoutId:useLayoutId(n)},{isStatic:u}=l,d=useCreateMotionContext(n),f=o(n,u);if(!u&&typeof window<`u`){useStrictMode(l,r);let t=getProjectionFunctionality(l);c=t.MeasureLayout,d.visualElement=useVisualElement(e,f,l,i,t.ProjectionNode,a)}return(0,C.jsxs)(I.Provider,{value:d,children:[c&&d.visualElement?(0,C.jsx)(c,{visualElement:d.visualElement,...l}):null,useRender(e,n,useMotionRef(f,d.visualElement,s),f,u,t,a)]})}MotionDOMComponent.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let s=(0,w.forwardRef)(MotionDOMComponent);return s[z]=e,s}function useLayoutId({layoutId:e}){let t=(0,w.useContext)(T).id;return t&&e!==void 0?t+`-`+e:e}function useStrictMode(e,t){(0,w.useContext)(k).strict}function getProjectionFunctionality(e){let{drag:t,layout:n}=getInitializedFeatureDefinitions();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}
9function createMotionProxy(e,t){if(typeof Proxy>`u`)return createMotionComponent;let n=new Map,factory=(n,r)=>createMotionComponent(n,r,e,t),deprecatedFactoryFunction=(e,t)=>factory(e,t);return new Proxy(deprecatedFactoryFunction,{get:(r,i)=>i===`create`?factory:(n.has(i)||n.set(i,createMotionComponent(i,void 0,e,t)),n.get(i))})}export{k as a,O as c,useConstant as d,T as f,loadFeatures as i,resolveMotionValue as l,isRefObject as n,AnimatePresence as o,B as r,usePresence as s,createMotionProxy as t,E 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.