hypnagaga/docs/assets/Framer.stories-e3257d6f.js
Jon McClure 925a9477f3 build
2023-09-18 08:02:26 +01:00

13 lines
25 KiB
JavaScript

import{S as ee,i as te,s as le,P as st,o as z,z as ne,y as T,g as B,b as d,c as Q,d as q,e as M,m as H,N as L,A as De,t as E,h as V,f as U,j as R,O as oe,X as We,E as $,l as Me,C as K,a4 as be,Y as he,Z as at,u as Le,q as ze,r as Ie,a3 as se,K as Ee,D as Oe,L as ue,a2 as Ve,_ as P,R as pe,p as Y,T as ge,v as Te,w as Ce,x as rt,k as Ne,V as ot,M as ut,H as ft}from"./index-4f5e5369.js";import{g as fe,a as qe}from"./spread-8a54911c.js";import{w as dt,p as ct,M as mt,T as bt,S as ht}from"./collect-stories-6e37d46b.js";import{F as ae}from"./fa-870bc0bd.js";import{e as pt,g as Ue,c as gt}from"./index.es-a32769a3.js";import{p as _t}from"./pym.v1-7344f633.js";import{u as yt}from"./index-b62d9356.js";import{e as _e}from"./each-e59479a4.js";import{w as kt}from"./withParams-47e2ab71.js";import"./_commonjsHelpers-de833af9.js";const vt=`An embed tool for development in the Graphics Kit.
\`\`\`svelte
<script>
import { Framer } from '@reuters-graphics/graphics-components';
const embeds = ['/embeds/my-chart/index.html'];
<\/script>
<Framer embeds="{embeds}" />
\`\`\`
`,G=dt(660);function wt(e){let t,l,a,s=(e[7]||e[3])+"",n,i,u,f,o,m,F,k,p,v,g,S,_,w,A,W,D,b,h;return st(e[21]),m=new ae({props:{icon:pt,fw:!0}}),A=new ae({props:{icon:Ue,fw:!0}}),{c(){t=z("div"),l=z("div"),a=z("div"),n=ne(s),i=ne("px"),f=T(),o=z("button"),B(m.$$.fragment),k=T(),p=z("div"),v=z("div"),g=T(),S=z("div"),_=T(),w=z("button"),B(A.$$.fragment),d(a,"class","label svelte-g53f92"),d(a,"style",u=`opacity: ${e[5]||e[6]?1:0};`),d(o,"class","icon left svelte-g53f92"),o.disabled=F=e[3]===e[1],d(v,"class","track svelte-g53f92"),d(S,"class","handle svelte-g53f92"),d(S,"tabindex","0"),Q(S,"left","calc("+e[8]*100+"% - 5px)"),d(p,"class","slider-container svelte-g53f92"),d(w,"class","icon right svelte-g53f92"),w.disabled=W=e[3]===e[2],d(l,"class","slider svelte-g53f92"),d(t,"id","resizer"),d(t,"class","svelte-g53f92")},m(y,I){q(y,t,I),M(t,l),M(l,a),M(a,n),M(a,i),M(l,f),M(l,o),H(m,o,null),M(l,k),M(l,p),M(p,v),M(p,g),M(p,S),e[22](p),M(l,_),M(l,w),H(A,w,null),D=!0,b||(h=[L(window,"mousemove",e[9]),L(window,"mouseup",e[12]),L(window,"keydown",e[10]),L(window,"resize",e[21]),L(o,"click",e[16]),L(o,"focus",e[13]),L(o,"mouseover",e[13]),L(o,"mouseleave",e[14]),L(S,"mousedown",e[11]),L(S,"focus",e[13]),L(S,"blur",e[14]),L(w,"click",e[15]),L(w,"focus",e[13]),L(w,"mouseover",e[13]),L(w,"mouseleave",e[14])],b=!0)},p(y,[I]){(!D||I&136)&&s!==(s=(y[7]||y[3])+"")&&De(n,s),(!D||I&96&&u!==(u=`opacity: ${y[5]||y[6]?1:0};`))&&d(a,"style",u),(!D||I&10&&F!==(F=y[3]===y[1]))&&(o.disabled=F),(!D||I&256)&&Q(S,"left","calc("+y[8]*100+"% - 5px)"),(!D||I&12&&W!==(W=y[3]===y[2]))&&(w.disabled=W)},i(y){D||(E(m.$$.fragment,y),E(A.$$.fragment,y),D=!0)},o(y){V(m.$$.fragment,y),V(A.$$.fragment,y),D=!1},d(y){y&&U(t),R(m),e[22](null),R(A),b=!1,oe(h)}}}const x=90;function Ft(e,t,l){let a,s,n,i,u;We(e,G,c=>l(3,u=c));let{breakpoints:f=[330,510,660,930,1200]}=t,{maxFrameWidth:o=1200}=t,{minFrameWidth:m=320}=t,F,k=1200,p=!1,v=!1;const g=c=>Math.ceil(c/5)*5,S=()=>Math.round(n*i+a);let _=null;const w=c=>{if(!p||!F)return;const{left:N}=F.getBoundingClientRect();l(8,i=Math.min(Math.max(0,c.pageX-N),x)/x),l(7,_=g(S()))},A=c=>{if(!v)return;const{keyCode:N}=c,Z=x/n;N===39?l(8,i=Math.min(1,i+Z/x)):N===37&&l(8,i=Math.max(0,i-Z/x)),G.set(S())},W=c=>{l(5,p=!0),w(c)},D=()=>{l(5,p=!1),l(7,_=null),G.set(g(S()))},b=()=>{l(6,v=!0)},h=()=>{l(6,v=!1)},y=()=>{const c=f.filter(N=>N<=s).filter(N=>N>u);c.length===0?G.set(s):G.set(c[0])},I=()=>{const c=f.filter(N=>N<u);c.length===0?G.set(a):G.set(c.slice(-1)[0])};function C(){l(0,k=window.innerWidth)}function j(c){$[c?"unshift":"push"](()=>{F=c,l(4,F)})}return e.$$set=c=>{"breakpoints"in c&&l(17,f=c.breakpoints),"maxFrameWidth"in c&&l(18,o=c.maxFrameWidth),"minFrameWidth"in c&&l(19,m=c.minFrameWidth)},e.$$.update=()=>{e.$$.dirty&524288&&l(1,a=m),e.$$.dirty&262145&&l(2,s=Math.min(k-70,o)),e.$$.dirty&6&&l(20,n=s-a),e.$$.dirty&12&&u>s&&G.set(s),e.$$.dirty&1048586&&l(8,i=(u-a)/n)},[k,a,s,u,F,p,v,_,i,w,A,W,D,b,h,y,I,f,o,m,n,C,j]}class je extends ee{constructor(t){super(),te(this,t,Ft,wt,le,{breakpoints:17,maxFrameWidth:18,minFrameWidth:19})}}je.__docgen={version:3,name:"index.svelte",data:[{visibility:"public",description:null,keywords:[],name:"breakpoints",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"array",type:"array"}},{visibility:"public",description:null,keywords:[],name:"maxFrameWidth",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"number",type:"number"},defaultValue:1200},{visibility:"public",description:null,keywords:[],name:"minFrameWidth",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"number",type:"number"},defaultValue:320}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};const St=e=>{const t=e.map(n=>n.replace(/\?.+$/,"")).map(n=>n.replace(/index\.html$/,"")).map(n=>n.replace(/^http[s]*:\/\/[\w.]+\.com/,""));if(t.length===1)return[t[0].split("/").filter(n=>n).slice(-1)[0]];const l=t[0];let a=0;for(const n in l.split("/")){const i=l.split("/")[n];if(t.every(f=>f.split("/")[n]===i))a+=1;else break}if(a===l.split("/").length)return t;let s=0;for(const n in l.split("/").reverse()){const i=l.split("/").reverse()[n];if(t.every(f=>f.split("/").reverse()[n]===i))s+=1;else break}return t.map(n=>s>0?n.split("/").slice(a,s*-1).join("/"):n.split("/").slice(a).join("/"))},X={};X.simpleFilter=function(e,t){return t.filter(function(l){return X.test(e,l)})};X.test=function(e,t){return X.match(e,t)!==null};X.match=function(e,t,l){l=l||{};let a=0;const s=[],n=t.length;let i=0,u=0;const f=l.pre||"",o=l.post||"",m=l.caseSensitive&&t||t.toLowerCase();let F;e=l.caseSensitive&&e||e.toLowerCase();for(let k=0;k<n;k++)F=t[k],m[k]===e[a]?(F=f+F+o,a+=1,u+=1+u):u=0,i+=u,s[s.length]=F;return a===e.length?(i=m===e?1/0:i,{rendered:s.join(""),score:i}):null};X.filter=function(e,t,l){return!t||t.length===0?[]:typeof e!="string"?t:(l=l||{},t.reduce(function(a,s,n,i){let u=s;l.extract&&(u=l.extract(s));const f=X.match(e,u,l);return f!=null&&(a[a.length]={string:f.rendered,score:f.score,index:n,original:s}),a},[]).sort(function(a,s){const n=s.score-a.score;return n||a.index-s.index}))};const At=e=>({}),ye=e=>({});function Dt(e){let t;return{c(){t=ne(e[2])},m(l,a){q(l,t,a)},p(l,a){a&4&&De(t,l[2])},d(l){l&&U(t)}}}function Wt(e){let t,l,a,s,n,i,u,f,o,m,F;const k=e[10].label,p=Me(k,e,e[9],ye),v=p||Dt(e);let g=[{name:"search"},{type:"search"},{placeholder:"Search..."},{autocomplete:"off"},{spellcheck:"false"},e[6],{id:e[4]}],S={};for(let _=0;_<g.length;_+=1)S=K(S,g[_]);return{c(){t=z("form"),l=z("label"),v&&v.c(),n=T(),i=z("input"),d(l,"id",a=e[4]+"-label"),d(l,"for",e[4]),d(l,"style",s=e[3]&&"position: absolute;height: 1px;width: 1px;overflow: hidden;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);white-space: nowrap;"),be(i,S),d(t,"data-svelte-search",""),d(t,"role",u=e[5]?null:"search"),d(t,"aria-labelledby",f=e[5]?null:e[4])},m(_,w){q(_,t,w),M(t,l),v&&v.m(l,null),M(t,n),M(t,i),i.autofocus&&i.focus(),e[17](i),he(i,e[0]),o=!0,m||(F=[L(i,"input",e[18]),L(i,"input",e[12]),L(i,"change",e[13]),L(i,"focus",e[14]),L(i,"blur",e[15]),L(i,"keydown",e[16]),L(t,"submit",at(e[11]))],m=!0)},p(_,[w]){p?p.p&&(!o||w&512)&&Le(p,k,_,_[9],o?Ie(k,_[9],w,At):ze(_[9]),ye):v&&v.p&&(!o||w&4)&&v.p(_,o?w:-1),(!o||w&16&&a!==(a=_[4]+"-label"))&&d(l,"id",a),(!o||w&16)&&d(l,"for",_[4]),(!o||w&8&&s!==(s=_[3]&&"position: absolute;height: 1px;width: 1px;overflow: hidden;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);white-space: nowrap;"))&&d(l,"style",s),be(i,S=fe(g,[{name:"search"},{type:"search"},{placeholder:"Search..."},{autocomplete:"off"},{spellcheck:"false"},w&64&&_[6],(!o||w&16)&&{id:_[4]}])),w&1&&i.value!==_[0]&&he(i,_[0]),(!o||w&32&&u!==(u=_[5]?null:"search"))&&d(t,"role",u),(!o||w&48&&f!==(f=_[5]?null:_[4]))&&d(t,"aria-labelledby",f)},i(_){o||(E(v,_),o=!0)},o(_){V(v,_),o=!1},d(_){_&&U(t),v&&v.d(_),e[17](null),m=!1,oe(F)}}}function Mt(e,t,l){const a=["value","autofocus","debounce","label","hideLabel","id","ref","removeFormAriaAttributes"];let s=se(t,a),{$$slots:n={},$$scope:i}=t,{value:u=""}=t,{autofocus:f=!1}=t,{debounce:o=0}=t,{label:m="Label"}=t,{hideLabel:F=!1}=t,{id:k="search"+Math.random().toString(36)}=t,{ref:p=null}=t,{removeFormAriaAttributes:v=!1}=t;const g=Ee();let S=u,_,w=!1;function A(c){w||(w=!0,_=setTimeout(()=>{c(),w=!1},o))}Oe(()=>(f&&window.requestAnimationFrame(()=>p.focus()),()=>clearTimeout(_))),ue(()=>{u.length>0&&u!==S&&(o>0?A(()=>g("type",u)):g("type",u)),u.length===0&&S.length>0&&g("clear"),S=u});function W(c){P.call(this,e,c)}function D(c){P.call(this,e,c)}function b(c){P.call(this,e,c)}function h(c){P.call(this,e,c)}function y(c){P.call(this,e,c)}function I(c){P.call(this,e,c)}function C(c){$[c?"unshift":"push"](()=>{p=c,l(1,p)})}function j(){u=this.value,l(0,u)}return e.$$set=c=>{t=K(K({},t),Ve(c)),l(6,s=se(t,a)),"value"in c&&l(0,u=c.value),"autofocus"in c&&l(7,f=c.autofocus),"debounce"in c&&l(8,o=c.debounce),"label"in c&&l(2,m=c.label),"hideLabel"in c&&l(3,F=c.hideLabel),"id"in c&&l(4,k=c.id),"ref"in c&&l(1,p=c.ref),"removeFormAriaAttributes"in c&&l(5,v=c.removeFormAriaAttributes),"$$scope"in c&&l(9,i=c.$$scope)},[u,p,m,F,k,v,s,f,o,i,n,W,D,b,h,y,I,C,j]}class Pe extends ee{constructor(t){super(),te(this,t,Mt,Wt,le,{value:0,autofocus:7,debounce:8,label:2,hideLabel:3,id:4,ref:1,removeFormAriaAttributes:5})}}const Lt=Pe;Pe.__docgen={version:3,name:"Search.svelte",data:[{keywords:[],visibility:"public",description:"Specify the input value",name:"value",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"",bind:[{source:"input",property:"value"}]},{keywords:[],visibility:"public",description:"Set to `true` to auto focus the input on mount",name:"autofocus",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1},{keywords:[],visibility:"public",description:"Specify the debounce value in milliseconds (ms)",name:"debounce",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"number",type:"number"},defaultValue:0},{keywords:[],visibility:"public",description:"Specify the input label text",name:"label",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"Label"},{keywords:[],visibility:"public",description:"Set to `true` to visually hide the label",name:"hideLabel",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1},{keywords:[],visibility:"public",description:"Specify an `id` for the `input`",name:"id",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{keywords:[{name:"type",description:"{HTMLInputElement}"}],visibility:"public",description:"Obtain a reference to the `input` element",name:"ref",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"HTMLInputElement",type:"HTMLInputElement"},defaultValue:null},{keywords:[],visibility:"public",description:'Set to `true` to omit the form `role="search"` attribute',name:"removeFormAriaAttributes",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1}],computed:[],methods:[],components:[],description:null,keywords:[],events:[{visibility:"public",description:null,keywords:[],name:"type"},{visibility:"public",description:null,keywords:[],name:"clear"},{keywords:[],visibility:"public",description:"",name:"submit",parent:"form",modificators:["preventDefault"],locations:null},{keywords:[],visibility:"public",description:"",name:"input",parent:"input",modificators:[],locations:null},{keywords:[],visibility:"public",description:"",name:"change",parent:"input",modificators:[],locations:null},{keywords:[],visibility:"public",description:"",name:"focus",parent:"input",modificators:[],locations:null},{keywords:[],visibility:"public",description:"",name:"blur",parent:"input",modificators:[],locations:null},{keywords:[],visibility:"public",description:"",name:"keydown",parent:"input",modificators:[],locations:null}],slots:[{keywords:[],visibility:"public",description:"",name:"label"}],refs:[]};function ke(e,t,l){const a=e.slice();return a[46]=t[l],a[48]=l,a}const zt=e=>({result:e[0]&2,value:e[0]&1}),ve=e=>({result:e[46],index:e[48],value:e[0]});function we(e){let t,l,a=_e(e[1]),s=[];for(let i=0;i<a.length;i+=1)s[i]=Fe(ke(e,a,i));const n=i=>V(s[i],1,1,()=>{s[i]=null});return{c(){for(let i=0;i<s.length;i+=1)s[i].c();t=Ne()},m(i,u){for(let f=0;f<s.length;f+=1)s[f]&&s[f].m(i,u);q(i,t,u),l=!0},p(i,u){if(u[0]&16778759){a=_e(i[1]);let f;for(f=0;f<a.length;f+=1){const o=ke(i,a,f);s[f]?(s[f].p(o,u),E(s[f],1)):(s[f]=Fe(o),s[f].c(),E(s[f],1),s[f].m(t.parentNode,t))}for(Te(),f=a.length;f<s.length;f+=1)n(f);Ce()}},i(i){if(!l){for(let u=0;u<a.length;u+=1)E(s[u]);l=!0}},o(i){s=s.filter(Boolean);for(let u=0;u<s.length;u+=1)V(s[u]);l=!1},d(i){i&&U(t),ot(s,i)}}}function It(e){let t,l=e[46].string+"",a;return{c(){t=new ft(!1),a=Ne(),t.a=a},m(s,n){t.m(l,s,n),q(s,a,n)},p(s,n){n[0]&2&&l!==(l=s[46].string+"")&&t.p(l)},d(s){s&&(U(a),t.d())}}}function Fe(e){let t,l,a,s,n,i,u;const f=e[25].default,o=Me(f,e,e[24],ve),m=o||It(e);function F(){return e[38](e[46],e[48])}function k(){return e[39](e[46],e[48])}return{c(){t=z("li"),m&&m.c(),l=T(),d(t,"role","option"),d(t,"id",a=e[2]+"-result-"+e[48]),d(t,"aria-selected",s=e[9]===e[48]),d(t,"class","svelte-fbh1wz"),Y(t,"selected",e[9]===e[48]),Y(t,"disabled",e[46].disabled)},m(p,v){q(p,t,v),m&&m.m(t,null),M(t,l),n=!0,i||(u=[L(t,"click",F),L(t,"mouseenter",k)],i=!0)},p(p,v){e=p,o?o.p&&(!n||v[0]&16777219)&&Le(o,f,e,e[24],n?Ie(f,e[24],v,zt):ze(e[24]),ve):m&&m.p&&(!n||v[0]&2)&&m.p(e,n?v:[-1,-1]),(!n||v[0]&4&&a!==(a=e[2]+"-result-"+e[48]))&&d(t,"id",a),(!n||v[0]&512&&s!==(s=e[9]===e[48]))&&d(t,"aria-selected",s),(!n||v[0]&512)&&Y(t,"selected",e[9]===e[48]),(!n||v[0]&2)&&Y(t,"disabled",e[46].disabled)},i(p){n||(E(m,p),n=!0)},o(p){V(m,p),n=!1},d(p){p&&U(t),m&&m.d(p),i=!1,oe(u)}}}function Se(e){let t;return{c(){t=z("li"),t.textContent="No embeds found...",d(t,"class","no-results disabled svelte-fbh1wz")},m(l,a){q(l,t,a)},d(l){l&&U(t)}}}function Et(e){let t,l,a,s,n,i,u,f,o,m,F,k,p,v,g;const S=[{id:e[2]},{removeFormAriaAttributes:!0},e[14],{"aria-autocomplete":"list"},{"aria-controls":e[2]+"-listbox"},{"aria-labelledby":e[2]+"-label"},{"aria-activedescendant":e[9]>=0&&!e[4]&&e[1].length>0?`${e[2]}-result-${e[9]}`:null}];function _(b){e[27](b)}function w(b){e[28](b)}let A={};for(let b=0;b<S.length;b+=1)A=K(A,S[b]);e[8]!==void 0&&(A.ref=e[8]),e[0]!==void 0&&(A.value=e[0]),l=new Lt({props:A}),$.push(()=>pe(l,"ref",_)),$.push(()=>pe(l,"value",w)),l.$on("type",e[29]),l.$on("input",e[30]),l.$on("change",e[31]),l.$on("focus",e[32]),l.$on("focus",e[33]),l.$on("clear",e[34]),l.$on("clear",e[12]),l.$on("blur",e[35]),l.$on("keydown",e[36]),l.$on("keydown",e[37]);let W=e[6]&&we(e),D=e[0].length>0&&e[1].length===0&&Se();return{c(){t=z("div"),B(l.$$.fragment),n=T(),i=z("ul"),W&&W.c(),u=T(),D&&D.c(),d(i,"role","listbox"),d(i,"aria-labelledby",f=e[2]+"-label"),d(i,"id",o=e[2]+"-listbox"),d(i,"class","svelte-fbh1wz"),Y(i,"svelte-typeahead-list",!0),d(t,"data-svelte-typeahead",""),d(t,"role","combobox"),d(t,"aria-haspopup","listbox"),d(t,"aria-owns",m=e[2]+"-listbox"),d(t,"aria-expanded",F=e[6]||e[5]&&e[0].length>0&&e[1].length===0),d(t,"id",k=e[2]+"-typeahead"),d(t,"class","svelte-fbh1wz"),Y(t,"dropdown",e[1].length>0)},m(b,h){q(b,t,h),H(l,t,null),M(t,n),M(t,i),W&&W.m(i,null),M(i,u),D&&D.m(i,null),e[40](t),p=!0,v||(g=L(window,"click",e[26]),v=!0)},p(b,h){const y=h[0]&16918?fe(S,[h[0]&4&&{id:b[2]},S[1],h[0]&16384&&qe(b[14]),S[3],h[0]&4&&{"aria-controls":b[2]+"-listbox"},h[0]&4&&{"aria-labelledby":b[2]+"-label"},h[0]&534&&{"aria-activedescendant":b[9]>=0&&!b[4]&&b[1].length>0?`${b[2]}-result-${b[9]}`:null}]):{};!a&&h[0]&256&&(a=!0,y.ref=b[8],ge(()=>a=!1)),!s&&h[0]&1&&(s=!0,y.value=b[0],ge(()=>s=!1)),l.$set(y),b[6]?W?(W.p(b,h),h[0]&64&&E(W,1)):(W=we(b),W.c(),E(W,1),W.m(i,u)):W&&(Te(),V(W,1,1,()=>{W=null}),Ce()),b[0].length>0&&b[1].length===0?D||(D=Se(),D.c(),D.m(i,null)):D&&(D.d(1),D=null),(!p||h[0]&4&&f!==(f=b[2]+"-label"))&&d(i,"aria-labelledby",f),(!p||h[0]&4&&o!==(o=b[2]+"-listbox"))&&d(i,"id",o),(!p||h[0]&4&&m!==(m=b[2]+"-listbox"))&&d(t,"aria-owns",m),(!p||h[0]&99&&F!==(F=b[6]||b[5]&&b[0].length>0&&b[1].length===0))&&d(t,"aria-expanded",F),(!p||h[0]&4&&k!==(k=b[2]+"-typeahead"))&&d(t,"id",k),(!p||h[0]&2)&&Y(t,"dropdown",b[1].length>0)},i(b){p||(E(l.$$.fragment,b),E(W),p=!0)},o(b){V(l.$$.fragment,b),V(W),p=!1},d(b){b&&U(t),R(l),W&&W.d(),D&&D.d(),e[40](null),v=!1,g()}}}function Ot(e,t,l){let a,s,n;const i=["id","value","data","extract","disable","filter","autoselect","inputAfterSelect","results","focusAfterSelect","showDropdownOnFocus","limit"];let u=se(t,i),{$$slots:f={},$$scope:o}=t;const m=rt(f);let{id:F="typeahead-"+Math.random().toString(36)}=t,{value:k=""}=t,{data:p=[]}=t,{extract:v=r=>r}=t,{disable:g=r=>!1}=t,{filter:S=r=>!1}=t,{autoselect:_=!0}=t,{inputAfterSelect:w="update"}=t,{results:A=[]}=t,{focusAfterSelect:W=!1}=t,{showDropdownOnFocus:D=!1}=t,{limit:b=1/0}=t;const h=Ee();let y=null,I=null,C=!1,j=-1,c="",N=!1;ue(()=>{c!==s&&_&&l(9,j=He()),c!==s&&!m["no-results"]&&l(4,C=A.length===0),c=s});async function Z(){const r=A[j];if(r.disabled)return;const O=v(r.original),J=k;w==="clear"&&l(0,k=""),w==="update"&&l(0,k=O),h("select",{selectedIndex:j,searched:J,selected:O,original:r.original,originalIndex:r.index}),await ut(),W&&I.focus(),ie()}function He(){var J,me;let r=0,O=((J=A[r])==null?void 0:J.disabled)??!1;for(;O;)r===A.length?r=0:r+=1,O=((me=A[r])==null?void 0:me.disabled)??!1;return r}function re(r){let O=r===1&&j===A.length-1?0:j+r;O<0&&(O=A.length-1);let J=A[O].disabled;for(;J;)O===A.length?O=0:O+=r,J=A[O].disabled;l(9,j=O)}const ce=()=>l(4,C=!1),ie=()=>l(4,C=!0),Re=({target:r})=>{!C&&!(y!=null&&y.contains(r))&&ie()};function Ge(r){I=r,l(8,I)}function Ke(r){k=r,l(0,k)}function Xe(r){P.call(this,e,r)}function Je(r){P.call(this,e,r)}function Ye(r){P.call(this,e,r)}function Ze(r){P.call(this,e,r)}const Qe=()=>{ce(),D&&(l(6,n=!0),l(5,N=!0))};function xe(r){P.call(this,e,r)}function $e(r){P.call(this,e,r)}function et(r){P.call(this,e,r)}const tt=r=>{if(A.length!==0)switch(r.key){case"Enter":Z();break;case"ArrowDown":r.preventDefault(),re(1);break;case"ArrowUp":r.preventDefault(),re(-1);break;case"Escape":r.preventDefault(),l(0,k=""),I==null||I.focus(),ie();break}},lt=(r,O)=>{r.disabled||(l(9,j=O),Z())},it=(r,O)=>{r.disabled||l(9,j=O)};function nt(r){$[r?"unshift":"push"](()=>{y=r,l(7,y)})}return e.$$set=r=>{t=K(K({},t),Ve(r)),l(14,u=se(t,i)),"id"in r&&l(2,F=r.id),"value"in r&&l(0,k=r.value),"data"in r&&l(15,p=r.data),"extract"in r&&l(16,v=r.extract),"disable"in r&&l(17,g=r.disable),"filter"in r&&l(18,S=r.filter),"autoselect"in r&&l(19,_=r.autoselect),"inputAfterSelect"in r&&l(20,w=r.inputAfterSelect),"results"in r&&l(1,A=r.results),"focusAfterSelect"in r&&l(21,W=r.focusAfterSelect),"showDropdownOnFocus"in r&&l(3,D=r.showDropdownOnFocus),"limit"in r&&l(22,b=r.limit),"$$scope"in r&&l(24,o=r.$$scope)},e.$$.update=()=>{e.$$.dirty[0]&65536&&l(23,a={pre:"<mark>",post:"</mark>",extract:v}),e.$$.dirty[0]&13074433&&l(1,A=k!==""?X.filter(k,p,a).filter(({score:r})=>r>0).slice(0,b).filter(r=>!S(r.original)).map(r=>({...r,disabled:g(r.original)})):p.map(r=>({string:v(r),original:r}))),e.$$.dirty[0]&65538&&(s=A.map(r=>v(r.original)).join("")),e.$$.dirty[0]&50&&l(6,n=!C&&A.length>0&&N),e.$$.dirty[0]&104&&D&&l(6,n=n&&N)},[k,A,F,D,C,N,n,y,I,j,Z,re,ce,ie,u,p,v,g,S,_,w,W,b,a,o,f,Re,Ge,Ke,Xe,Je,Ye,Ze,Qe,xe,$e,et,tt,lt,it,nt]}class Vt extends ee{constructor(t){super(),te(this,t,Ot,Et,le,{id:2,value:0,data:15,extract:16,disable:17,filter:18,autoselect:19,inputAfterSelect:20,results:1,focusAfterSelect:21,showDropdownOnFocus:3,limit:22},null,[-1,-1])}}function Tt(e){let t,l,a,s,n,i,u,f,o,m,F,k,p,v,g,S,_,w,A,W,D,b;return f=new ae({props:{icon:gt}}),m=new Vt({props:{label:"Select an embed",value:e[6][e[0].indexOf(e[4])]||e[6][e[5]]||e[6][0],extract:e[8],data:e[0].map(Ae),placeholder:"Search",showDropdownOnFocus:!0}}),m.$on("select",e[9]),A=new ae({props:{icon:Ue}}),D=new je({props:{breakpoints:e[1],minFrameWidth:e[2],maxFrameWidth:e[3]}}),{c(){t=z("div"),l=z("header"),l.innerHTML='<img src="https://graphics.thomsonreuters.com/style-assets/images/logos/reuters-graphics-logo/svg/graphics-logo-dark.svg" alt=""/>',a=T(),s=z("div"),n=z("div"),i=z("a"),u=ne("Live link "),B(f.$$.fragment),o=T(),B(m.$$.fragment),F=T(),k=z("div"),p=z("p"),p.textContent="Preview",v=T(),g=z("div"),S=T(),_=z("div"),w=z("a"),B(A.$$.fragment),W=T(),B(D.$$.fragment),d(l,"class","svelte-6lwy9l"),d(i,"rel","external"),d(i,"target","_blank"),d(i,"href",e[4]),d(i,"title",e[4]),d(i,"class","svelte-6lwy9l"),d(n,"class","embed-link svelte-6lwy9l"),d(s,"id","typeahead-container"),d(s,"class","svelte-6lwy9l"),d(p,"class","svelte-6lwy9l"),d(k,"id","preview-label"),Q(k,"width",e[7]+"px"),d(k,"class","svelte-6lwy9l"),d(g,"id","frame-parent"),Q(g,"width",e[7]+"px"),d(g,"class","svelte-6lwy9l"),d(t,"class","container"),d(w,"rel","external"),d(w,"href","./../"),d(w,"class","svelte-6lwy9l"),d(_,"id","home-link"),d(_,"class","svelte-6lwy9l")},m(h,y){q(h,t,y),M(t,l),M(t,a),M(t,s),M(s,n),M(n,i),M(i,u),H(f,i,null),M(s,o),H(m,s,null),M(t,F),M(t,k),M(k,p),M(t,v),M(t,g),q(h,S,y),q(h,_,y),M(_,w),H(A,w,null),q(h,W,y),H(D,h,y),b=!0},p(h,[y]){(!b||y&16)&&d(i,"href",h[4]),(!b||y&16)&&d(i,"title",h[4]);const I={};y&113&&(I.value=h[6][h[0].indexOf(h[4])]||h[6][h[5]]||h[6][0]),y&64&&(I.extract=h[8]),y&1&&(I.data=h[0].map(Ae)),m.$set(I),(!b||y&128)&&Q(k,"width",h[7]+"px"),(!b||y&128)&&Q(g,"width",h[7]+"px");const C={};y&2&&(C.breakpoints=h[1]),y&4&&(C.minFrameWidth=h[2]),y&8&&(C.maxFrameWidth=h[3]),D.$set(C)},i(h){b||(E(f.$$.fragment,h),E(m.$$.fragment,h),E(A.$$.fragment,h),E(D.$$.fragment,h),b=!0)},o(h){V(f.$$.fragment,h),V(m.$$.fragment,h),V(A.$$.fragment,h),V(D.$$.fragment,h),b=!1},d(h){h&&(U(t),U(S),U(_),U(W)),R(f),R(m),R(A),R(D,h)}}}const Ae=(e,t)=>({index:t,embed:e});function Ct(e,t,l){let a,s;We(e,G,g=>l(7,s=g));let{embeds:n}=t,{breakpoints:i=[330,510,660,930,1200]}=t,{minFrameWidth:u=320}=t,{maxFrameWidth:f=1200}=t,m=(()=>{if(typeof window>"u")return n[0];const g=window.localStorage.getItem("framer-active-embed");return g&&n.indexOf(g)>-1?g:n[0]})(),F=n.indexOf(m);const k=g=>{const S=n.indexOf(g)>-1?g:n[F]||n[0];new _t.Parent("frame-parent",/^http/.test(S)?S:yt(window.location.origin,S,{trailingSlash:!0}))};Oe(()=>{k(m)}),ue(()=>{k(m)});const p=g=>a[g.index],v=({detail:g})=>{typeof window<"u"&&window.localStorage.setItem("framer-active-embed",g.original.embed),l(4,m=g.original.embed),l(5,F=g.original.index)};return e.$$set=g=>{"embeds"in g&&l(0,n=g.embeds),"breakpoints"in g&&l(1,i=g.breakpoints),"minFrameWidth"in g&&l(2,u=g.minFrameWidth),"maxFrameWidth"in g&&l(3,f=g.maxFrameWidth)},e.$$.update=()=>{e.$$.dirty&1&&l(6,a=St(n))},[n,i,u,f,m,F,a,s,p,v]}class de extends ee{constructor(t){super(),te(this,t,Ct,Tt,le,{embeds:0,breakpoints:1,minFrameWidth:2,maxFrameWidth:3})}}de.__docgen={version:3,name:"Framer.svelte",data:[{visibility:"public",description:null,keywords:[],name:"embeds",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"breakpoints",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"array",type:"array"}},{visibility:"public",description:null,keywords:[],name:"minFrameWidth",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"number",type:"number"},defaultValue:320},{visibility:"public",description:null,keywords:[],name:"maxFrameWidth",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"number",type:"number"},defaultValue:1200}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};function Nt(e){let t,l;const a=[e[0]];let s={};for(let n=0;n<a.length;n+=1)s=K(s,a[n]);return t=new de({props:s}),{c(){B(t.$$.fragment)},m(n,i){H(t,n,i),l=!0},p(n,i){const u=i&1?fe(a,[qe(n[0])]):{};t.$set(u)},i(n){l||(E(t.$$.fragment,n),l=!0)},o(n){V(t.$$.fragment,n),l=!1},d(n){R(t,n)}}}function qt(e){let t,l,a,s,n,i;const u=[{title:"Components/Framer"},{component:de},kt(vt)];let f={};for(let o=0;o<u.length;o+=1)f=K(f,u[o]);return t=new mt({props:f}),a=new bt({props:{$$slots:{default:[Nt,({args:o})=>({0:o}),({args:o})=>o?1:0]},$$scope:{ctx:e}}}),n=new ht({props:{name:"Default",args:{embeds:["https://graphics.reuters.com/USA-CONGRESS/FUNDRAISING/zjvqkawjlvx/embeds/en/embed/?zzz"]}}}),{c(){B(t.$$.fragment),l=T(),B(a.$$.fragment),s=T(),B(n.$$.fragment)},m(o,m){H(t,o,m),q(o,l,m),H(a,o,m),q(o,s,m),H(n,o,m),i=!0},p(o,[m]){const F={};t.$set(F);const k={};m&3&&(k.$$scope={dirty:m,ctx:o}),a.$set(k)},i(o){i||(E(t.$$.fragment,o),E(a.$$.fragment,o),E(n.$$.fragment,o),i=!0)},o(o){V(t.$$.fragment,o),V(a.$$.fragment,o),V(n.$$.fragment,o),i=!1},d(o){o&&(U(l),U(s)),R(t,o),R(a,o),R(n,o)}}}class Ut extends ee{constructor(t){super(),te(this,t,null,qt,le,{})}}const Be=ct(Ut,{meta:{title:"Components/Framer"},stories:{"tpl:default":{name:"default",template:!0,source:"<Framer {...args} />",hasArgs:!0},Default:{name:"Default",template:!1,source:"",hasArgs:!1}},allocatedIds:["default","Meta","Template","Story","componentDocs","Framer","withComponentDocs"]}),Zt=Be.meta,Qt=["Default"],xt=Be.stories.Default;export{xt as Default,Qt as __namedExportsOrder,Zt as default};
//# sourceMappingURL=Framer.stories-e3257d6f.js.map