UGCAgentsKnowledgeItemDialog.react",["fbt","CDSDialog.react","CDSDialogFooter.react","CDSDialogHeader.react","CDSTextAreaInput.react","CDSTextInput.react","CDSTextPairing.react","CometColumn.react","CometColumnItem.react","UGCAgentsKnowledgeItemPreview.react","isStringNullOrEmpty","react","useDebouncedComet","useGenAIUGCAgentsCreateKnowledgeItemMutation","useGenAIUGCAgentsUpdateKnowledgeItemMutation"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j=i||(i=d("react"));b=i;var k=b.useEffect,l=b.useState;function a(a){a=a.props;var b=a.connectionID,d=a.existingContext,e=a.existingDescription,f=a.existingID,g=a.existingUrl,i=a.onClose,m=a.personaVersionID,n=a.type;a=l(g!=null?g:"");var o=a[0],p=a[1];a=l(g!=null?g:"");g=a[0];var q=a[1];a=l(null);var r=a[0],s=a[1];a=l(e!=null?e:"");var t=a[0];e=a[1];a=l(d!=null?d:"");var u=a[0];d=a[1];a=c("useGenAIUGCAgentsCreateKnowledgeItemMutation")({onComplete:function(){i()}});var v=a[0];a=a[1];var w=c("useGenAIUGCAgentsUpdateKnowledgeItemMutation")({onComplete:function(){i()}}),x=w[0];w=w[1];var y=c("useDebouncedComet")(function(){q(o)},{wait:1e3}),z=function(a){p(a),y()},A=j.jsx(c("CDSDialogHeader.react"),{onClose:i,titleHidden:!0});a=a||w;w=!c("isStringNullOrEmpty")(o)&&!c("isStringNullOrEmpty")(t)&&!c("isStringNullOrEmpty")(u)&&r===!0;w=j.jsx(c("CDSDialogFooter.react"),{primary:{disabled:a||!w,label:h._(/*BTDS*/"Save"),onPress:function(){f!=null?x({connectionID:b,context:u,description:t,itemID:f,personaVersionID:m,type:n,url:o}):v({connectionID:b,context:u,description:t,personaVersionID:m,type:n,url:o})},testid:"ugc-avatar-editor-save-continue-button",tooltip:w?null:h._(/*BTDS*/"Please fill out all fields and ensure that the link is valid (preview will be generated)"),tooltipPosition:"above"},secondary:{disabled:a,label:h._(/*BTDS*/"Cancel"),onPress:i}});a=null;n==="LINK"?a={context:h._(/*BTDS*/"When should your AI share this link?"),description:h._(/*BTDS*/"How should your AI describe this link?"),heading:h._(/*BTDS*/"Add link"),subheading:h._(/*BTDS*/"Add a link and description to help the AI understand when to share it."),url:h._(/*BTDS*/"Link")}:n==="MEDIA"&&(a={context:h._(/*BTDS*/"When should your AI share this reel?"),description:h._(/*BTDS*/"How should your AI describe this reel?"),heading:h._(/*BTDS*/"Add reel"),subheading:h._(/*BTDS*/"Add a Reel and description to help the AI understand when to share it."),url:h._(/*BTDS*/"Paste a reel URL from Instagram.com")});k(function(){o===""&&s(null)},[o,s]);if(a==null)return null;r=r===!0?"CORRECT":r===!1?"ERROR":null;return j.jsx(c("CDSDialog.react"),{footer:w,header:A,children:j.jsxs(c("CometColumn.react"),{paddingHorizontal:20,spacing:20,children:[j.jsx(c("CometColumnItem.react"),{children:j.jsx(c("CDSTextPairing.react"),{contentText:a.subheading,headlineText:a.heading,textAlign:"start",textPairingStyle:"headline1Body"})}),j.jsx(c("CometColumnItem.react"),{children:j.jsx(c("CDSTextInput.react"),{helperText:r==="ERROR"?h._(/*BTDS*/"Please enter a valid URL."):null,inputMode:"url",label:a.url,onValueChange:z,validationState:r,value:o})}),g!==""&&j.jsx(c("CometColumnItem.react"),{style:{marginBottom:0,marginTop:0},children:j.jsx(c("UGCAgentsKnowledgeItemPreview.react"),{setIsPreviewGenerated:s,type:n,url:g})}),j.jsx(c("CometColumnItem.react"),{children:j.jsx(c("CDSTextPairing.react"),{contentText:j.jsx(c("CDSTextAreaInput.react"),{maxRows:6,minRows:1,onValueChange:d,placeholder:h._(/*BTDS*/"Add details"),value:u}),headlineText:a.context,textAlign:"start",textPairingStyle:"headline3Body"})}),j.jsx(c("CometColumnItem.react"),{children:j.jsx(c("CDSTextPairing.react"),{contentText:j.jsx(c("CDSTextAreaInput.react"),{maxRows:6,minRows:1,onValueChange:e,placeholder:h._(/*BTDS*/"Add details"),value:t}),headlineText:a.description,textAlign:"start",textPairingStyle:"headline3Body"})})]})})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),226);
-----
useGenAIUGCAgentsUpdateKnowledgeItemMutation",["RelayHooks","react","useGenAIUGCAgentsUpdateKnowledgeItemMutation.graphql"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j=(i||d("react")).useCallback,k=h!==void 0?h:h=b("useGenAIUGCAgentsUpdateKnowledgeItemMutation.graphql");function a(a){var b=a.onComplete,c=a.onError;a=d("RelayHooks").useMutation(k);var e=a[0];a=a[1];var f=j(function(a){var d=a.connectionID,f=a.context,g=a.description,h=a.itemID,i=a.personaVersionID,j=a.type;a=a.url;e({onCompleted:function(a){a=(a=a.result)==null||(a=a.updated_link)==null?void 0:a.id;b(a!=null?a:void 0)},onError:function(a){c==null||c(a)},variables:{connectionID:d,input:{context:f,description:g,item_id:h,item_type:j,persona_version_id:i,url:a}}})},[e,b,c]);return[f,a]}g["default"]=a}),98);
-----
useGenAIUGCAgentsUpdateKnowledgeItemMutation_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="31153938867553226"}),null);
-----